function parent(parentElement: HTMLElement | any, className): HTMLElement {
  if (!parentElement) {
    return null;
  }
  if (parentElement.classList.contains(className)) {
    return parentElement;
  } else {
    return parent(parentElement.parentElement, className);
  }
}

export {parent}
